package com.wf.contorller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value="/userinfo")
public class UserinfoController  {
    private final Logger logger=Logger.getLogger(UserinfoController.class);


   @HystrixCommand(fallbackMethod="getUserListBack")
   @RequestMapping(value = "/getUserList/{name}", method = RequestMethod.GET)
   public String getUserList(@PathVariable(value = "name") String name){
       int a=0/1;
       return name;
   }

    public String getUserListBack(String name){
        return "error"+name;
    }

}
